package com.example.springbootdemo.exception;

/**
 * 异常信息枚举类
 * @author hh
 * @date 2022/1/19
 */
public enum BusinessResponseEnum {

    ACCESS_DENIED(205, "权限不足"),
    AUTHENTICATION_FAILED(204, "认证失败"),
    USER_MAX_LOGIN(203, "同一账号不能同时多处登录"),
    USER_LOGIN_TIMEOUT(202, "用户登录超时"),
    USER_LOGIN_FAIL(201, "内部错误，登录失败"),
    USER_LOCKED(109, "用户被锁定"),
    USER_DISABLED(108, "用户被禁用"),
    USER_PASSWORD_EXPIRED(107, "用户密码过期"),
    USER_PASSWORD_ERROR(106, "用户密码错误"),
    USER_ACCOUNT_EXPIRED(105, "用户账号过期"),
    UNAUTH_EXCEPTION(104, "无权访问，请先登录"),
    LOGIN_FAIL(103, "登录失败"),
    DATA_EXCEPTION(102, "发现多个用户"),
    PARMETER_EXCEPTION(101, "参数异常"),

    SUCCESS(200, "成功"),
    COMMON_FAIL(100, "失败");

    private final int code;
    private final String value;

    BusinessResponseEnum(int code, String value){
        this.code = code;
        this.value = value;
    }

    public int code(){
        return this.code;
    }

    public String value(){
        return this.value;
    }

}
